"no need for abs position, check window change
let windowX=[]
let windowY=[]
fun! InitializeWListY()
	let g:windowX=[winnr()]
	wincmd k
	while g:windowX[0]!=winnr()
		call insert(g:windowX,winnr())
		wincmd k
	endwhile
	exe g.windowX[-1].'wincmd w'
	wincmd j
	while g:windowX[-1]!=winnr() 
		call add(g:windowX,winnr())
		wincmd j
	endwhile
endfun
fun! InitializeWListX()
endfun
fun! GetAbsPosX()
endfun
fun! GetAbsPosY()
endfun
fun! ResizeY(x)
	let origwin=winnr()
	let rescount=0
	if a:x<0
		let curwin=0
		let actionLst=[]
		while curwin!=winnr()
			let curwin=winnr()
			if winheight(0)-1>(-a:x-rescount)
				let rescount+=insert(actionLst,[curwin,-a:x-rescount])[-1][1]
				break
			elseif winheight(0)>1 
				let rescount+=insert(actionLst,[curwin,winheight(0)-1])[-1][1]
			else
				call insert(actionLst,[curwin,0])
			endif
			wincmd k
		endwhile
		let sum=0
		for i in actionLst
			let sum+=i[1]
			exe i[0].'wincmd w|res -'.sum
		endfor
	else if a:x>0
		let curwin=origwin
		wincmd j
		while rescount<a:x && winnr()!=curwin
			let curwin=winnr()
			let rescount+=winheight(0)-1
			wincmd j
		endwhile
		exe origwin.'wincmd w|res +'.min([a:x,rescount])
	endif
endfun
